<?php

class BackgroundIt
{
	public function run($cmd, $path_to_php)
	{
		if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN")
		{
			$WshShell = new COM("WScript.Shell");
			$oExec = $WshShell->Run($path_to_php." ".$cmd, 7, false);
		}
		else
		{
			system($path_to_php." ".$cmd." > /dev/null &");
		}
        return 1;
	}

    public function sys($cmd, $path_to_php)
    {
        return system($path_to_php." ".$cmd);
    }
} 